package com.mydesign.demo.service.Impl;

import com.mydesign.demo.model.ReturnResult;

import com.mydesign.demo.service.IFileService;
import com.mydesign.demo.util.ImageUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class FileServiceImpl implements IFileService {
    @Override
    public ReturnResult uploadFile(MultipartFile file) {
            String s = ImageUtil.uploadFileImage(file);
            if(StringUtils.isEmpty(s)){
                return ReturnResult.error();
            }else {
                return ReturnResult.dataSuccess(s);
        }
    }
}
